//
//  WebViewViewController.m
//  HandWork
//
//  Created by 王阳阳 on 16/1/26.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "WebViewViewController.h"
#import "UMSocial.h"
@interface WebViewViewController ()<UMSocialUIDelegate>

@end


@implementation WebViewViewController

- (void)dealloc
{
    [_strid release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];//背景颜色
    
    
    
    UIBarButtonItem *collect = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"collect"] style:UIBarButtonItemStylePlain target:self action:@selector(collect)];
    
    UIBarButtonItem *fenxiang = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"fenxiang"] style:UIBarButtonItemStylePlain target:self action:@selector(fenxiang)];
    self.navigationItem.rightBarButtonItems = @[collect, fenxiang];


    //网址
    NSString *str = [@"http://h5.m.taobao.com/cm/snap/index.html?u_channel=1-23259936&umpChannel=1-23259936&exParams=%7B%22umpChannel%22:%221-23259936%22,%22u_channel%22:%221-23259936%22,%22referer%22:%22showTaoKeItemDetail%22%7D&ttid=2014_0_23259936@baichuan_ios_1.8.3&id="stringByAppendingString:self.strid];
    NSLog(@"%@",str);
    //创建WebView
    
    UIWebView *web = [[UIWebView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    [web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [self.view addSubview:web];//添加
    [web release];
}

- (void)fenxiang
{
    [UMSocialSnsService presentSnsIconSheetView:self
                                         appKey:@"56a87643e0f55a9fc20020c2"
                                      shareText:@"你要分享的文字"
                                     shareImage:[UIImage imageNamed:@"icon.png"]
                                shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToWechatSession,UMShareToQQ,nil]
                                       delegate:self];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
